package com.kotasoft.training.roogwteclipselink.client.managed.ui;

import com.google.gwt.requestfactory.ui.client.ProxyRenderer;

import com.kotasoft.training.roogwteclipselink.client.managed.request.MatriculaProxy;
import com.kotasoft.training.roogwteclipselink.client.managed.request.AlumnoProxy;
import java.util.Set;
import com.kotasoft.training.roogwteclipselink.client.managed.request.AsignaturaProxy;
import com.kotasoft.training.roogwteclipselink.client.managed.ui.AsignaturaSetEditor;

/**
 * Renders {@link MatriculaProxy for display to the user. Requires the
 *  properties to have been fetched.
 */
public class MatriculaProxyRenderer extends ProxyRenderer<MatriculaProxy> {
  private static MatriculaProxyRenderer INSTANCE;

  public static MatriculaProxyRenderer instance() {
    if (INSTANCE == null) {
      INSTANCE = new MatriculaProxyRenderer();
    }

    return INSTANCE;
  }

  protected MatriculaProxyRenderer() {
    super(new String[] {"carrera"});
  }

  public String render(MatriculaProxy object) {
    if (object == null) {
      return "";
    }
    return object.getCarrera() + " (" + object.getId() + ")";
  }
}
